home *** CD-ROM | disk | FTP | other *** search
Wrap
/* ** $VER: Neon.ieb 1.0, IE Arexx script ** Image Engineer Batch Processing script ** Copyright © by Patrik M Nydensten ** 25/1 1997 Stockholm/Sweden ** ** Creates neon light lines out of image's color edges. ** Based on the Neon.rexx 1.11 script. */ options results signal on error parse arg input command input = upper(strip(input)) address 'IMAGEENGINEER' select /* Required batch script commands */ when input = 'INFO' then return get_info() when input = 'CONFIG' then return get_config(command) when input = 'PROCESS' then return process_image(command) otherwise do 'REQUEST' '"Failure in call to batch script!"' '" Quit "' return '<ERROR>' end end exit 0 /* Required "Get_info" procedure ------------------------------------ */ /* S = SECONDARY, A = ALPHA, 1 = Single file, 2 = Multiple files */ get_info: back = 'OK' return back /* Required "Get_config" procedure ---------------------------------- */ get_config: parse arg '"'command'"' Thick=3 ; Sharp=1 if command ~= '' then parse var command Thick Sharp 'IE_TO_FRONT' 'FORM "Neon" " OK | Cancel "', ' TEXT,"Creates neon light lines from image'x2c(27)'s color edges."', ' INTEGER,"Neon thick size",1,12,'Thick',SLIDER', ' INTEGER,"Neon sharp size",1,12,'Sharp',SLIDER' parse var result ok Thick Sharp if ok = 0 then return '<ERROR>' back = Thick Sharp return back /* Required "Process_image" procedure ------------------------------- */ process_image: parse arg '"'src_image'"' '"'dst_image'"' '"'options'"' parse var options Thick Sharp 'OPEN' '"'src_image'"' '24' if (RC ~= 0) then do 'IE_TO_FRONT' 'REQUEST' '"Failed to load image:' d2c(10)||src_image'"' '" OK "' return '<ERROR>' end else LoadImage = Result Sharp = (Sharp*2-1) Thick = (Thick*2-1) 'CONVOLVE' LoadImage '"IE:Convolves/ColourLine_Thin"' LineImage = Result 'CLOSE' LoadImage if Thick ~= 1 then do 'MAXIMUM' LineImage Thick Thick MaxThickImage = Result 'LOWPASS' MaxThickImage trunc((2+Thick)/2) trunc((2+Thick)/2) ThickImage = Result 'CLOSE' MaxThickImage end else ThickImage = LineImage 'MAXIMUM' LineImage Sharp Sharp SharpImage = Result if Thick ~= 1 then 'CLOSE' LineImage 'MARK' ThickImage 'PRIMARY' 'MARK' SharpImage 'SECONDARY' 'COMPOSITE' 0 0 'ADD' OutputImage = Result 'CLOSE' ThickImage 'CLOSE' SharpImage if getclip('cfg_save_frmt')='' then setclip('cfg_save_frmt','ILBM CmpByteRun1') 'SAVE_DATA' OutputImage '"'dst_image'"' '"'getclip('cfg_save_frmt')'"' if (RC ~= 0) then do 'IE_TO_FRONT' 'REQUEST' '"Failed to save image:' d2c(10)||dst_image'"' '" OK "' return '<ERROR>' end 'CLOSE' OutputImage back = 'OK' return back /* Internal procedures ---------------------------------------------- */ /*******************************************************************/ /* This is where control goes when an error code is returned by IE */ /* It puts up a message saying what happened and on which line */ /*******************************************************************/ error: if RC=5 then do IE_TO_FRONT LAST_ERROR 'REQUEST "'||RESULT||'"' end else do IE_TO_FRONT LAST_ERROR 'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!' end return '<ERROR>'